<%@page import="java.util.Arrays"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>检测用户页面</title>
</head>
<body>
	<%
		request.setCharacterEncoding("utf-8");
		String[] userList = {"JAVA", "C#", "ASP.NET"};
		String user = request.getParameter("user");
		Arrays.sort(userList);
		int result = Arrays.binarySearch(userList, user);
		if (result > 1) {
			out.println("很抱歉，该用户名已被注册");
		} else {
			out.println("恭喜你，该用户名未被注册");
		}
	%>
</body>
</html>